package com.gillion.grule.client.core;

import com.gillion.grule.client.core.variable.PackageVariable;
import java.util.List;
import java.util.Map;




public class ContextBuilder
{
    private Context context = new Context();





    public static ContextBuilder newBuilder() {
        return new ContextBuilder();
    }






    public ContextBuilder addParam(Object param) {
        this.context.getParams().add(param);
        return this;
    }






    public ContextBuilder addParams(Object... args) {
        for (Object arg : args) {
            addParam(arg);
        }
        return this;
    }






    public ContextBuilder addParams(List<Object> args) {
        for (Object arg : args) {
            addParam(arg);
        }
        return this;
    }






    public ContextBuilder variable(PackageVariable packageVariable) {
        this.context.setPackageVariable(packageVariable);
        return this;
    }






    public ContextBuilder dataSource(List<DataSourceClient> dataSources) {
        this.context.setDataSources(dataSources);
        return this;
    }






    public ContextBuilder remoteConfig(List<RemoteConfig> remoteConfig) {
        this.context.setRemoteConfig(remoteConfig);
        return this;
    }






    public ContextBuilder springCloudConfig(List<SpringCloudConfig> springCloudConfig) {
        this.context.setSpringCloudConfig(springCloudConfig);
        return this;
    }






    public ContextBuilder groovyShellConfig(List<GroovyShellConfig> groovyShellConfigs) {
        this.context.setGroovyShellConfigs(groovyShellConfigs);
        return this;
    }






    public ContextBuilder dubboConfig(List<DubboConfig> dubboConfig) {
        this.context.setDubboConfig(dubboConfig);
        return this;
    }

    public ContextBuilder validatorConfig(Map<String, Map<String, Object>> validatorConfig) {
        this.context.setValidatorConfig(validatorConfig);
        return this;
    }





    public Context build() {
        return this.context;
    }
}